Skip to content

fix(save): write the b section's unsaved edits on save - #171

Merged
dustenhubbard merged 1 commit into
mainfrom
fix/83-save-b-section
Oct 16, 2026
Merged

dustenhubbard merged 1 commit into
mainfrom
fix/83-save-b-section

Conversation

@dustenhubbard

Copy link
Copy Markdown
Member

After a flicker, the section you flickered away from keeps its unsaved edits in memory as the b section. Save and Save As wrote only the current section, so those edits were left out of the .jser. Save now writes the b section too. A section you have deleted is not written back, even if it is still the b section.

The undo problem this issue describes does not happen on main. SectionStates.initialize builds the undo baseline from memory, not from the file on disk, and the change that would have read the file (#82) was closed. The lost edit in the issue's Notes is the real bug, and this fixes it.

Closes #83.

A flicker changes section without saving, so edits made on the section
you flicker away from stay in memory as the b section. saveAllData wrote
only the current section, so Save and Save As left those edits out of
the .jser.

saveAllData now writes the b section too. Section.save skips a section
that is no longer in the series, because a deleted section can still be
the b section and must not get its file back.
@dustenhubbard
dustenhubbard merged commit f9378b6 into main Oct 16, 2026
6 checks passed
@dustenhubbard
dustenhubbard deleted the fix/83-save-b-section branch October 16, 2026 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Save As can capture a stale undo baseline for an edited background section

1 participant